// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Custom/Transparent/Diffuse(RGB+A)_Lambert_Test"
{
	Properties
	{
		_Color ("Main Color", Color) = (1,1,1,1)
		_MainTex ("Base (RGB)", 2D) = "white" {}
		_AlphaTex ("Alpha Tex",2D) = "white" {}
	}

    SubShader {
       	Tags { "RenderType" = "Transparent"  "Queue" = "Transparent" "IgnoreProjector" = "True"}
        
        Cull Off
        Blend SrcAlpha OneMinusSrcAlpha
        pass{
            CGPROGRAM

            #include "UnityCG.cginc"
            sampler2D _MainTex;
            float4 _MainTex_ST;
            sampler2D _AlphaTex;

            struct v2f
            {
                float4 pos: SV_POSITION;
                float2 uv: TEXCOORD0;
                float4 grabPos: TEXCOORD1;
            };

            v2f vert(appdata_base v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
                return o;
            }
            
            fixed4 frag(v2f i): SV_Target
            {   
                fixed4 col = fixed4(0,0,0,1);
                fixed3 c = tex2D(_MainTex,i.uv);
               fixed3 a = tex2D(_AlphaTex,i.uv);
                
                col = fixed4(c,a.r);
                return col;
            }
            
            #pragma vertex vert
            #pragma fragment frag

            ENDCG
        }
    }
    
}
